cmake_minimum_required (VERSION 3.8)

#project(wolfssl)

include_directories(".")

add_definitions(-DWOLFSSL_LIB)
add_definitions(-DWOLFSSL_USER_SETTINGS)
add_definitions(-DCYASSL_USER_SETTINGS)
add_definitions(-DWOLFSSL_IGNORE_FILE_WARN)
add_definitions(-DHAVE_FIPS)
#add_definitions(-DOPENSSL_EXTRA)


IF(CMAKE_BUILD_TYPE MATCHES "Debug" AND WIN32)
	add_definitions(-D__DEBUG__)
	add_definitions(-D__WIN32__)
	add_definitions(-D_LIB)
ELSEIF((CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") AND WIN32)
	add_definitions(-D__WIN32__)
	add_definitions(-D_LIB)
ELSEIF(CMAKE_BUILD_TYPE MATCHES "Debug" AND UNIX)
	add_definitions(-D__DEBUG__)
	add_definitions(-D__LINUX__)
	add_definitions(-fpermissive)
ELSEIF((CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") AND UNIX)
	add_definitions(-D__LINUX__)
	add_definitions(-fpermissive)
ENDIF()

file(GLOB wolfssl_srcs "wolfcrypt/src/*.c*")
add_library(wolfssl_objs OBJECT ${wolfssl_srcs})
add_library(wolfssl STATIC $<TARGET_OBJECTS:wolfssl_objs>)
